#shader vertex
#version 330 core

layout(location = 0) in vec4 position;
layout(location = 1) in vec2 textureCoord;

out vec2 TexCoord;

uniform mat4 transform;
uniform mat4 model_trans;
uniform mat4 view_trans;
uniform mat4 projection_trans;

void main()
{
    mat4 m = mat4(1.0);
    m = m * transform;
    //gl_Position = position;
    //gl_Position = m * position;
    gl_Position = projection_trans * view_trans * model_trans * position;
    TexCoord = textureCoord;
}


#shader fragment
#version 330 core

layout(location = 0) out vec4 color;

in vec2 TexCoord;

uniform vec4 u_Color;
uniform float u_Alpha;
uniform sampler2D u_Texture;
uniform sampler2D u_Texture2;

void main()
{
    //vec4 texColor = texture(u_Texture, TexCoord) * vec4(u_Color);
    //vec4 texColor = mix(texture(u_Texture, TexCoord), texture(u_Texture2, TexCoord), 0.2);
    vec4 texColor = mix(texture(u_Texture, TexCoord), texture(u_Texture2, vec2(TexCoord.x, 1.0 - TexCoord.y)), u_Alpha);
    //color = u_Color;
    color = texColor;
}